home *** CD-ROM | disk | FTP | other *** search
- Path: cea.fr!usenet
- From: Xavier Tarrago <tarrago@lcus15.saclay.cea.fr>
- Newsgroups: comp.lang.c++
- Subject: Re: Performance: C vs. C++
- Date: 6 Feb 1996 13:13:06 GMT
- Organization: CEA Commissariat a l'Energie Atomique, France.
- Message-ID: <4f7k52$4u4@news.cea.fr>
- References: <30F6BAAC.12B5@iastate.edu> <4da9pn$a45@news.bridge.net> <4dnpl2$c8g@classic.iinet.com.au> <31032A4F.6695@iastate.edu> <3108F495.4828@enermet.fi> <DLt9u3.FnJ@mv.mv.com>
- NNTP-Posting-Host: lcus15.saclay.cea.fr
-
- I didn't read the begenning of this thread but its subject seems
- interesting to me. So...
- I found some difference between C & C++ perf.
- I tried to use Complex class to realize FFT algoritm. I found C
- implementation
- /* Complex */
- double re;
- double im;
- ..
-
- 2 time faster than C++
- complex<double> c;
-
- I think that it is due to better optimisation of
- re3 = re1*re2 - im1*im2;
- im3 = re1*im2 + re2*im1;
- than
- c3 = c2 * c1;
- because of construction of temporaries.
-
- The first implementation gave the same perf in C & C++
- But using complex objects was much slower.
-
- I wonder if someone tried to implement some scientific library
- whith C++ and compared perf versus some similar lib in C
-
- X. Tarrago
-